import service from '../request'

// --------table---------------
// 获取表格数据
export let table_list = () => {
    return service({
        url: "/table",
        method: "GET"
    })
}

// 新增
export function add_list(params = {}) {
    return service.post('/table/?key=${id}', params)
}

// 删除
export let del_list = (id) => {
    return service({
        url: "/table/" + id,
        method: "DELETE"
    })
}

// 搜索
// export let search_list = (name) => {
//     return service({
//         url: "/table",
//         method: "GET",
//         data: {
//             name,
//         }
//     })
// }
export function search_list(name) {
    return service.get(`/table/?name=${name}`,)
}

// 修改表格
export function put_list( params = {}) {
    return service.patch(`/table/${params.id}`, params)
}



// ----------tableb------------------
// 获取表格数据
export let tableb_list = () => {
    return service({
        url: "/tableb",
        method: "GET"
    })
}

// 新增
export function add_listb(params = {}) {
    return service.post('/tableb/?key=${id}', params)
}

// 删除
export let del_listb = (id) => {
    return service({
        url: "/tableb/" + id,
        method: "DELETE"
    })
}

// 搜索
export function search_listb(name) {
    return service.get(`/tableb/?name=${name}`,)
}
// --------------tablec--------------------
// 获取表格数据
export let tablec_list = () => {
    return service({
        url: "/tablec",
        method: "GET"
    })
}

// 新增
export function add_listc(params = {}) {
    return service.post('/tablec/?key=${id}', params)
}

// 删除
export let del_listc = (id) => {
    return service({
        url: "/tablec/" + id,
        method: "DELETE"
    })
}

// 搜索
export function search_listc(name) {
    return service.get(`/tablec/?name=${name}`,)
}

// 查看详情
export let look_list = (id) => {
    return service({
        url: "/tablec/" + id,
        method: "GET"
    })
}
